
// https://github.com/type-challenges/type-challenges/blob/master/questions/13-warm-hello-world/README.md
type HelloWorld = string; // ??? 没了？？？

// https://github.com/type-challenges/type-challenges/blob/master/questions/4-easy-pick/README.md
type MyPick<T, K extends keyof T> = {
    [Key in K]: T[Key];
}

// https://github.com/type-challenges/type-challenges/blob/master/questions/7-easy-readonly/README.md
type MyReadonly<T> = {
    readonly [Key in keyof T]: T[Key];
}
  
// https://github.com/type-challenges/type-challenges/blob/master/questions/11-easy-tuple-to-object/README.md
type TupleToObject<T extends readonly any[]> = {
    [Key in T[number]]: Key;
  }
  
// https://github.com/type-challenges/type-challenges/blob/master/questions/14-easy-first/README.md
type First<T extends any[]> = T extends {
    0: infer First
  } ? First : never;

// https://github.com/type-challenges/type-challenges/blob/master/questions/43-easy-exclude/README.md
type MyExclude<T, U> = T extends U ? never : T;

const myIsString = (str: unknown): str is string => {
  return typeof str === "string";
}
function toUpperCase(x: unknown) {
  if(myIsString(x)) {
    x.toUpperCase();
  }
}
